Smart Dustbin using Arduino Uno

Dustbin have been important part of our life. But, the issue we have to deal is its open cap. Due to this open cap, insect and flies visit the garbage and also the same flies roam around out kitchen or lunch buffet. This leads to serious health issue. In order to solve this issue, we had design here a Smart Dustbin using Arduino Uno. This smart dustbin automatic open its cap when we pass our hand above it.

Component Required for Smart Dustbin usign Arduino Uno

Arduino Uno Board

Servo Motor

HC-SR04 Ultrasonic Sensor

ON/OFF Switch

10K Pull-up Resistor

Circuit Description of Smart Dustbin using Arduino Uno

The circuit of smart dustbin is shown in figure 1. As we know that Arduino Uno board consist ATmega328 AVR microcontroller which is heart of the board. It is accompanied by other components like a power supply, ultrasonic module HC-SR04 and servo motor.

The ultrasonic sensor echo pin and trigger pin is connected to pin digital pin D7 and D8. The +Vcc pin is connected to +5V supply and GND pin is connected to ground pin of arduino uno board. The control (PWM) pin of servo motor is connected to digital pin D9 of arduino. Hence, servo motor is used to open the cap of dustbin.

For this project and components used, the preset level of distance between dustbin and hand is fixed to 30 to 70 cm.

smart dustbin using arduino uno

Ultrasonic Sensor: Ultrasonic sensor HC-SR04 module is used to locate the distance between the dustbin and hands of user. The principle behind finding distance of obstacle is sonar wave. It only detects obstacle when Trigger pin receive high pulse for the period more then 10 us. When this sensor verifies the presence of hand (obstacle) it starts to send eight cycles of ultrasonic burst at 40 KHz and then it waits for reflected ultrasonic signal.

As we know that there are two drums in ultrasonic sensor module where one is for transmitting ultrasonic pulse where other drums is for receiving ultrasonic signal.

Once ultrasonic detect obstacle, the echo pin of module is set high. Waiting period of reflected pulse is completely dependent upon the location of obstacle. When the echo signal is obtained, we can calculate the distance by using the formula

Distance (in cm) = (duration/2) / 29.1

Various other project using Ultrasonic posted in bestengineeringprojects.com

  1. Arduino Based Car Reverse Alarm
  2. Ultrasonic Water Level Meter
  3. Ultrasonic Lamp Brightness Controller

HC-SR04 Ultrasonic Sensor

Initially, the cap of dustbin is switched back to zero-degree position (Close) by the servo motor. The controller keeps on monitoring the signal receive from ultrasonic module. When ultrasonic module detects an obstacle, the controller check if it crosses a threshold distance value set for open the cap of dustbin. As soon as that happens, the controller triggers the servo motor when then open the cap for limited line (as set in software). For our prototype we had set time for 10 second.

Here in this project we had also used a ON/OFF switch, in order to activate and de-activated the smart dustbin when ever we want to use it. A pull-up resistor of 10K is connected in series of switch as shown in circuit diagram in order to solve the de-bouncing problem.

You can also use arduino NANO instead of arduino uno. You do not have to change source code because the board use identical pin for controlling servo motor, switch and ultrasonic sensor.

smart dustbin circuit using arduino nano

Software for Smart Dustbin using Arduino

The simplest part of the project smart dustbin using arduino is software part because it is clean, simple and easy to understand. The program check the distance had also used “Servo.h” inbuilt library function for servo operation. You can assume any value of motor rotation using “myServo.write(angle)” function but here we had only use two state of position (1) zero degree and (2) 1800.

The software source code is given below:

3 Thoughts to “Smart Dustbin using Arduino Uno”

  1. SUHANAH BINTI SURIONO .

    how u download the Arduino uno and ultrasonic sensor component for Proteus? can you give me link to download it.

  2. MOHD AIMAN BIN MOHD ADNAN

    how to know if the circuit diagram is work. because my motor only rotate once (90 degree)

    1. If you are facing any issue in your project please go through the making video.
      Thankyou.

Leave a Comment